#include "student.h"

Student::Student(QObject *parent)
    : QObject{parent}, dailyCheck(20, std::vector<bool>(4))
{}

int stuSubjectCost(Student& x,int y) {
    if(x.ifChoose[y]==false) {
        return 0;
    }
    int temp = 0;
    for(int i=0;i<x.dailyCheck.size();i++) {
        if(x.dailyCheck[i][y]) {
            temp++;
        }
    }
    return temp*x.classCost[y];
}

void processDate(Student& x) {
    QString temp[4] = {QString("，数学："), QString("，物理："), QString("，化学："), QString("，英语：")};
    QString yes("是");
    QString no("否");
    for(int i=0;i<x.dailyCheck.size();i++) {
        for(int j=0;j<4;j++) {
            if(x.dailyCheck[i][j]) {
                x.classDay[i] = x.classDay[i] + temp[j] + yes;
            } else if(x.ifChoose[j]) {
                x.classDay[i] = x.classDay[i] + temp[j] + no;
            }
        }
    }
}
